package com.greenline.push.core.pushcenter.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.greenline.push.core.pushcenter.ThrottleManager;
import com.greenline.push.dal.pushcenter.ThrottleDao;
import com.greenline.push.dal.pushcenter.dataobject.ThrottleDO;
import com.greenline.push.dal.query.ThrottleQuery;

public class ThrottleManagerImpl implements ThrottleManager {

	@Autowired
	private ThrottleDao throttleDao;

	@Override
	public Long insert(ThrottleDO throttleDO) {
		return throttleDao.insert(throttleDO);
	}

	@Override
	public ThrottleDO getById(Long id) {
		return throttleDao.getById(id);
	}

	@Override
	public boolean update(ThrottleDO throttleDO) {
		return throttleDao.update(throttleDO) > 0;
	}

	@Override
	public ThrottleQuery listByQuery(ThrottleQuery query) {
		return throttleDao.listByQuery(query);
	}

	@Override
	public boolean delete(Long id) {
		if (null == id) {
			return false;
		}
		return throttleDao.deleteById(id) > 0;
	}

    @Override
    public List<ThrottleDO> listByExample(ThrottleDO throttleDO) {
        return throttleDao.listByExample(throttleDO);
    }

}
